package com.cloudfun.campusshare.service;

import com.cloudfun.campusshare.common.model.dto.KjtSubMerchantDTO;
import com.cloudfun.campusshare.common.model.dto.kjt.KjtSubMerchantCreateDTO;
import com.cloudfun.campusshare.common.model.dto.kjt.KjtSubMerchantRegRespDTO;
import com.cloudfun.campusshare.common.model.dto.kjt.KjtSubMerchantResubmissionDTO;
import com.cloudfun.campusshare.common.model.vo.KjtSubMerchantVO;
import com.cloudfun.campusshare.entity.SubMerchantEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

/**
 * Created by CodeGenerator on 2020/08/10
 */
public interface KjtSubMerchantService {

    /**
     *  跳转快捷通创建子商户
     * @return
     */
    String createSubMerchantPage(String userId);

    /**
     * 创建子商户
     *
     * @param createDTO
     */
    void createSubMerchant(KjtSubMerchantCreateDTO createDTO);

    /**
     * 处理注册响应
     *
     * @param subMerchantRegRespDTO
     */
    void handleRegResponse(KjtSubMerchantRegRespDTO subMerchantRegRespDTO);

    /**
     * 准入资料重提
     *
     * @param reSubmissionDTO
     */
    void resubmission(KjtSubMerchantResubmissionDTO reSubmissionDTO);

    /**
     * 根据email查找
     *
     * @param email
     * @return
     */
    KjtSubMerchantVO getByEmail(String email);

    /**
     * 注册查询
     *
     * @return
     */
    KjtSubMerchantDTO regQuery();

    /**
     * 根据id查找
     *
     * @param id
     * @return
     */
    Optional<SubMerchantEntity> getEntityById(String id);

    /**
     * 根据用户id查找
     *
     * @param userId
     * @return
     */
    Optional<SubMerchantEntity> getEntityByUserId(String userId);

    /**
     * 根据IdentityId查找
     *
     * @param identityId
     * @return
     */
    Optional<SubMerchantEntity> getEntityByIdentityId(String identityId);

    /***
     * 获取所有
     * @return
     */
    List<SubMerchantEntity> getEntities();

    /**
     * 持久化
     *
     * @param subMerchantEntity
     */
    void save(SubMerchantEntity subMerchantEntity);
}